package top.tenebrous.yzl.grpc.proto.heatbeat;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.43.1)",
    comments = "Source: heatbeat/heatbeatService.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class HeatBeatServerGrpc {

  private HeatBeatServerGrpc() {}

  public static final String SERVICE_NAME = "top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatServer";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest,
      top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getAcceptMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "accept",
      requestType = top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest.class,
      responseType = top.tenebrous.yzl.grpc.proto.common.GrpcResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest,
      top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getAcceptMethod() {
    io.grpc.MethodDescriptor<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest, top.tenebrous.yzl.grpc.proto.common.GrpcResponse> getAcceptMethod;
    if ((getAcceptMethod = HeatBeatServerGrpc.getAcceptMethod) == null) {
      synchronized (HeatBeatServerGrpc.class) {
        if ((getAcceptMethod = HeatBeatServerGrpc.getAcceptMethod) == null) {
          HeatBeatServerGrpc.getAcceptMethod = getAcceptMethod =
              io.grpc.MethodDescriptor.<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest, top.tenebrous.yzl.grpc.proto.common.GrpcResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "accept"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  top.tenebrous.yzl.grpc.proto.common.GrpcResponse.getDefaultInstance()))
              .setSchemaDescriptor(new HeatBeatServerMethodDescriptorSupplier("accept"))
              .build();
        }
      }
    }
    return getAcceptMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static HeatBeatServerStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerStub>() {
        @java.lang.Override
        public HeatBeatServerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HeatBeatServerStub(channel, callOptions);
        }
      };
    return HeatBeatServerStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static HeatBeatServerBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerBlockingStub>() {
        @java.lang.Override
        public HeatBeatServerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HeatBeatServerBlockingStub(channel, callOptions);
        }
      };
    return HeatBeatServerBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static HeatBeatServerFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<HeatBeatServerFutureStub>() {
        @java.lang.Override
        public HeatBeatServerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HeatBeatServerFutureStub(channel, callOptions);
        }
      };
    return HeatBeatServerFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class HeatBeatServerImplBase implements io.grpc.BindableService {

    /**
     * <pre>
     * 接收心跳
     * </pre>
     */
    public io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest> accept(
        io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getAcceptMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getAcceptMethod(),
            io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
              new MethodHandlers<
                top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest,
                top.tenebrous.yzl.grpc.proto.common.GrpcResponse>(
                  this, METHODID_ACCEPT)))
          .build();
    }
  }

  /**
   */
  public static final class HeatBeatServerStub extends io.grpc.stub.AbstractAsyncStub<HeatBeatServerStub> {
    private HeatBeatServerStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected HeatBeatServerStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new HeatBeatServerStub(channel, callOptions);
    }

    /**
     * <pre>
     * 接收心跳
     * </pre>
     */
    public io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatRequest> accept(
        io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getAcceptMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class HeatBeatServerBlockingStub extends io.grpc.stub.AbstractBlockingStub<HeatBeatServerBlockingStub> {
    private HeatBeatServerBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected HeatBeatServerBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new HeatBeatServerBlockingStub(channel, callOptions);
    }
  }

  /**
   */
  public static final class HeatBeatServerFutureStub extends io.grpc.stub.AbstractFutureStub<HeatBeatServerFutureStub> {
    private HeatBeatServerFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected HeatBeatServerFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new HeatBeatServerFutureStub(channel, callOptions);
    }
  }

  private static final int METHODID_ACCEPT = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final HeatBeatServerImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(HeatBeatServerImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_ACCEPT:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.accept(
              (io.grpc.stub.StreamObserver<top.tenebrous.yzl.grpc.proto.common.GrpcResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class HeatBeatServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    HeatBeatServerBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return top.tenebrous.yzl.grpc.proto.heatbeat.HeatBeatServiceGrpc.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("HeatBeatServer");
    }
  }

  private static final class HeatBeatServerFileDescriptorSupplier
      extends HeatBeatServerBaseDescriptorSupplier {
    HeatBeatServerFileDescriptorSupplier() {}
  }

  private static final class HeatBeatServerMethodDescriptorSupplier
      extends HeatBeatServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    HeatBeatServerMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (HeatBeatServerGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new HeatBeatServerFileDescriptorSupplier())
              .addMethod(getAcceptMethod())
              .build();
        }
      }
    }
    return result;
  }
}
